 MACRO
&lab _DialogStartUp
&lab ldx #$0215
 jsl $E10000
 MEND
 MACRO
&lab _DialogShutDown
&lab ldx #$0315
 jsl $E10000
 MEND
 MACRO
&lab _EMStartUp
&lab ldx #$0206
 jsl $E10000
 MEND
 MACRO
&lab _EMShutDown
&lab ldx #$0306
 jsl $E10000
 MEND
 MACRO
&lab _IMStartUp
&lab ldx #$020B
 jsl $E10000
 MEND
 MACRO
&lab _Int2Hex
&lab ldx #$220B
 jsl $E10000
 MEND
 MACRO
&lab _LEStartUp
&lab ldx #$0214
 jsl $E10000
 MEND
 MACRO
&lab _LEShutDown
&lab ldx #$0314
 jsl $E10000
 MEND
 MACRO
&lab _TLStartUp
&lab ldx #$0201
 jsl $E10000
 MEND
 MACRO
&lab _TLShutDown
&lab ldx #$0301
 jsl $E10000
 MEND
 MACRO
&lab _LoadTools
&lab ldx #$0E01
 jsl $E10000
 MEND
 MACRO
&lab _MMStartUp
&lab ldx #$0202
 jsl $E10000
 MEND
 MACRO
&lab _MMShutDown
&lab ldx #$0302
 jsl $E10000
 MEND
 MACRO
&lab _DisposeHandle
&lab ldx #$1002
 jsl $E10000
 MEND
 MACRO
&lab _NewHandle
&lab ldx #$0902
 jsl $E10000
 MEND
 MACRO
&lab _MTStartUp
&lab ldx #$0203
 jsl $E10000
 MEND
 MACRO
&lab _MTShutDown
&lab ldx #$0303
 jsl $E10000
 MEND
 MACRO
&lab _ReadAsciiTime
&lab ldx #$0F03
 jsl $E10000
 MEND
 MACRO
&lab _ReadTimeHex
&lab ldx #$0D03
 jsl $E10000
 MEND
 MACRO
&lab _ScrapStartUp
&lab ldx #$0216
 jsl $E10000
 MEND
 MACRO
&lab _ScrapShutDown
&lab ldx #$0316
 jsl $E10000
 MEND
 MACRO
&lab _ReadChar
&lab ldx #$220C
 jsl $E10000
 MEND
 MACRO
&lab _WriteCString
&lab ldx #$200C
 jsl $E10000
 MEND
 MACRO
&lab _CtlStartUp
&lab ldx #$0210
 jsl $E10000
 MEND
 MACRO
&lab _CtlShutDown
&lab ldx #$0310
 jsl $E10000
 MEND
 MACRO
&lab _DeskStartUp
&lab ldx #$0205
 jsl $E10000
 MEND
 MACRO
&lab _DeskShutDown
&lab ldx #$0305
 jsl $E10000
 MEND
 MACRO
&lab _FixAppleMenu
&lab ldx #$1E05
 jsl $E10000
 MEND
 MACRO
&lab _MenuStartUp
&lab ldx #$020F
 jsl $E10000
 MEND
 MACRO
&lab _MenuShutDown
&lab ldx #$030F
 jsl $E10000
 MEND
 MACRO
&lab _DrawMenuBar
&lab ldx #$2A0F
 jsl $E10000
 MEND
 MACRO
&lab _FixMenuBar
&lab ldx #$130F
 jsl $E10000
 MEND
 MACRO
&lab _GetMenuMgrPort
&lab ldx #$1B0F
 jsl $E10000
 MEND
 MACRO
&lab _HiliteMenu
&lab ldx #$2C0F
 jsl $E10000
 MEND
 MACRO
&lab _InsertMenu
&lab ldx #$0D0F
 jsl $E10000
 MEND
 MACRO
&lab _NewMenu
&lab ldx #$2D0F
 jsl $E10000
 MEND
 MACRO
&lab _QDStartUp
&lab ldx #$0204
 jsl $E10000
 MEND
 MACRO
&lab _QDShutDown
&lab ldx #$0304
 jsl $E10000
 MEND
 MACRO
&lab _CloseRgn
&lab ldx #$6E04
 jsl $E10000
 MEND
 MACRO
&lab _CStringWidth
&lab ldx #$AA04
 jsl $E10000
 MEND
 MACRO
&lab _DisposeRgn
&lab ldx #$6804
 jsl $E10000
 MEND
 MACRO
&lab _DrawChar
&lab ldx #$A404
 jsl $E10000
 MEND
 MACRO
&lab _DrawCString
&lab ldx #$A604
 jsl $E10000
 MEND
 MACRO
&lab _DrawString
&lab ldx #$A504
 jsl $E10000
 MEND
 MACRO
&lab _FrameRect
&lab ldx #$5304
 jsl $E10000
 MEND
 MACRO
&lab _FrameRRect
&lab ldx #$5D04
 jsl $E10000
 MEND
 MACRO
&lab _GetBackColor
&lab ldx #$A304
 jsl $E10000
 MEND
 MACRO
&lab _GetFont
&lab ldx #$9504
 jsl $E10000
 MEND
 MACRO
&lab _GetForeColor
&lab ldx #$A104
 jsl $E10000
 MEND
 MACRO
&lab _GetPenMode
&lab ldx #$2F04
 jsl $E10000
 MEND
 MACRO
&lab _GetPort
&lab ldx #$1C04
 jsl $E10000
 MEND
 MACRO
&lab _GetTextMode
&lab ldx #$9D04
 jsl $E10000
 MEND
 MACRO
&lab _GlobalToLocal
&lab ldx #$8504
 jsl $E10000
 MEND
 MACRO
&lab _GrafOff
&lab ldx #$0B04
 jsl $E10000
 MEND
 MACRO
&lab _LineTo
&lab ldx #$3C04
 jsl $E10000
 MEND
 MACRO
&lab _LocalToGlobal
&lab ldx #$8404
 jsl $E10000
 MEND
 MACRO
&lab _MoveTo
&lab ldx #$3A04
 jsl $E10000
 MEND
 MACRO
&lab _NewRgn
&lab ldx #$6704
 jsl $E10000
 MEND
 MACRO
&lab _OpenRgn
&lab ldx #$6D04
 jsl $E10000
 MEND
 MACRO
&lab _PaintRect
&lab ldx #$5404
 jsl $E10000
 MEND
 MACRO
&lab _PenNormal
&lab ldx #$3604
 jsl $E10000
 MEND
 MACRO
&lab _PtInRect
&lab ldx #$4F04
 jsl $E10000
 MEND
 MACRO
&lab _PtInRgn
&lab ldx #$7504
 jsl $E10000
 MEND
 MACRO
&lab _SetBackColor
&lab ldx #$A204
 jsl $E10000
 MEND
 MACRO
&lab _SetFont
&lab ldx #$9404
 jsl $E10000
 MEND
 MACRO
&lab _SetForeColor
&lab ldx #$A004
 jsl $E10000
 MEND
 MACRO
&lab _SetPenMode
&lab ldx #$2E04
 jsl $E10000
 MEND
 MACRO
&lab _SetPenSize
&lab ldx #$2C04
 jsl $E10000
 MEND
 MACRO
&lab _SetPort
&lab ldx #$1B04
 jsl $E10000
 MEND
 MACRO
&lab _SetSolidPenPat
&lab ldx #$3704
 jsl $E10000
 MEND
 MACRO
&lab _SetTextMode
&lab ldx #$9C04
 jsl $E10000
 MEND
 MACRO
&lab _ShowCursor
&lab ldx #$9104
 jsl $E10000
 MEND
 MACRO
&lab _StringWidth
&lab ldx #$A904
 jsl $E10000
 MEND
 MACRO
&lab _UnionRgn
&lab ldx #$7204
 jsl $E10000
 MEND
 MACRO
&lab _WindStartUp
&lab ldx #$020E
 jsl $E10000
 MEND
 MACRO
&lab _WindShutDown
&lab ldx #$030E
 jsl $E10000
 MEND
 MACRO
&lab _CloseWindow
&lab ldx #$0B0E
 jsl $E10000
 MEND
 MACRO
&lab _DragWindow
&lab ldx #$1A0E
 jsl $E10000
 MEND
 MACRO
&lab _FrontWindow
&lab ldx #$150E
 jsl $E10000
 MEND
 MACRO
&lab _HideWindow
&lab ldx #$120E
 jsl $E10000
 MEND
 MACRO
&lab _NewWindow
&lab ldx #$090E
 jsl $E10000
 MEND
 MACRO
&lab _RefreshDesktop
&lab ldx #$390E
 jsl $E10000
 MEND
 MACRO
&lab _SelectWindow
&lab ldx #$110E
 jsl $E10000
 MEND
 MACRO
&lab _ShowWindow
&lab ldx #$130E
 jsl $E10000
 MEND
 MACRO
&lab _TaskMaster
&lab ldx #$1D0E
 jsl $E10000
 MEND
 MACRO
&lab _TrackGoAway
&lab ldx #$180E
 jsl $E10000
 MEND
 MACRO
&lab _QUIT &params
&lab jsl $E100A8
 dc i2"$29"
 dc i4"&params"
 MEND
 MACRO
&lab pulllong &addr1,&addr2
&lab ANOP
 AIF C:&addr1=0,.a
 AIF C:&addr2=0,.b
 LCLC &C
&C AMID &addr1,1,1
 AIF "&C"="[",.zeropage
 pullword &addr1
 sta &addr2
 pullword &addr1+2
 sta &addr2+2
 MEXIT
.a
 pullword
 pullword
 MEXIT
.b
 pullword &addr1
 pullword &addr1+2
 MEXIT
.zeropage
 ldy #&addr2
 pullword &addr1,y
 ldy #&addr2+2
 pullword &addr1,y
 MEND
 MACRO
&lab pullword &SYSOPR
&lab ANOP
 pla
 AIF C:&SYSOPR=0,.end
 sta &SYSOPR
.end
 MEND
 MACRO
&lab pushlong &addr,&offset
&lab ANOP
 LCLC &C
 LCLC &REST
&C AMID &addr,1,1
 AIF "&C"="#",.immediate
 AIF "&C"="[",.zeropage
 AIF C:&offset=0,.nooffset
 AIF "&offset"="s",.stack
 pushword &addr+2,&offset
 pushword &addr,&offset
 MEXIT
.nooffset
 pushword &addr+2
 pushword &addr
 MEXIT
.immediate
&REST AMID &addr,2,L:&addr-1
 dc I1'$F4',I2'(&REST)|-16'
 dc I1'$F4',I2'&REST'
 MEXIT
.stack
 pushword &addr+2,s
 pushword &addr+2,s
 MEXIT
.zeropage
 ldy #&offset+2
 pushword &addr,y
 ldy #&offset
 pushword &addr,y
 MEND
 MACRO
&lab pushword &SYSOPR
&lab ANOP
 AIF C:&SYSOPR=0,.b
 LCLC &C
&C AMID "&SYSOPR",1,1
 AIF ("&C"="#").AND.(S:LONGA),.immediate
 lda &SYSOPR
 pha
 MEXIT
.b
 pha
 MEXIT
.immediate
 LCLC &REST
 LCLA &BL
&BL ASEARCH "&SYSOPR"," ",1
 AIF &BL>0,.a
&BL SETA L:&SYSOPR+1
.a
&REST AMID "&SYSOPR",2,&BL-2
 dc I1'$F4',I2'&REST'
 MEND
 MACRO
&lab add4 &a1,&a2,&a3
&lab ANOP
 LCLC &C1
 LCLC &C2
 LCLC &REST1
 LCLC &REST2
&C2 AMID &a2,1,1
&REST2 AMID &a2,2,L:&a2-1
 AIF C:&a1=0,.a
&C1 AMID &a1,1,1
&REST1 AMID &a1,2,L:&a1-1
 lda &a1
.a
 clc
 adc &a2
 sta &a3
 AIF C:&a1>0,.b
 lda #0
 AGO .d
.b
 AIF "&C1"="#",.c
 lda &a1+2
 AGO .d
.c
 lda #^&REST1
.d
 AIF "&C2"="#",.e
 adc &a2+2
 AGO .f
.e
 adc #^&REST2
.f
 sta &a3+2
 MEND
 MACRO
&lab str &string
&lab dc i1'L:&string',C'&string'
 MEND
